<?php
/**
 * Created by PhpStorm.
 * User: apple
 * Date: 2018/8/7
 * Time: 下午10:57
 */
namespace PddWechat\Models\User\Service;

use Dai\Framework\Base\BaseService;
use Dai\Framework\Base\BaseSessionInfo;
use PddWechat\Models\User\Data\UserData;

class DirectMemberNum extends BaseService
{
    public function __construct()
    {
        $this->userdata = new UserData();
    }

    public function execute($basePageInfo)
    {
        /** @var BaseSessionInfo $sessionData */
        $sessionData = $basePageInfo->sessionInfo;
        $openid = $sessionData->openId;
        $directNum = $this->userdata->getDirectMemberNumByOpenId($openid);
        return $directNum;
    }
}